<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>添加题目</title>
    <link rel="stylesheet" th:href="@{/static/css/layui.css}">
    <link rel="stylesheet" th:href="@{/static/css/admin/addQuestion.css}">
</head>
<body>
    <script th:if="${session.tUser.URole eq '0'}">window.location.href="/index"</script>

    <div id="gb">

        <div class="header">
            <i class="layui-icon layui-icon-component" style="color: white; margin-right: 5px; font-weight: bold; "></i>
            <span>添加题目</span>
        </div>

        <form class="layui-form">
            <input type="hidden" name="uId" th:value="${session.tUser.UId}">

            <div class="layui-form-item">
                <label class="layui-form-label">题目</label>
                <div class="layui-input-block">
                    <textarea name="qTitle" id="qTitle" required lay-verify="required" placeholder="请输入题目" class="layui-textarea" style="resize: none"></textarea>
                </div>
            </div>

            <!--题目类型  1表示单选  2表示多选  3表示简答-->
            <div class="layui-form-item">
                <label class="layui-form-label">题目类型</label>
                <div class="layui-input-inline">
                    <select class="qType" lay-filter="Select" name="qType">
                        <option value="1" selected>单选题</option>
                        <option value="2" >多选题</option>
                        <option value="3" >简答题</option>
                    </select>
                </div>
            </div>

            <!--选择题choices-->
            <div class="layui-form-item choices">
                <div class="layui-form-item">
                    <label class="layui-form-label">选项A</label>
                    <div class="layui-input-block">
                        <input type="text" name="qAnswer1" placeholder="请输入A选项内容" autocomplete="off" class="layui-input qAnswer1">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">选项B</label>
                    <div class="layui-input-block">
                        <input type="text" name="qAnswer2"placeholder="请输入B选项内容" autocomplete="off" class="layui-input qAnswer2">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">选项C</label>
                    <div class="layui-input-block">
                        <input type="text" name="qAnswer3" placeholder="请输入C选项内容" autocomplete="off" class="layui-input qAnswer3">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">选项D</label>
                    <div class="layui-input-block">
                        <input type="text" name="qAnswer4"  placeholder="请输入D选项内容" autocomplete="off" class="layui-input qAnswer4">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">正确答案</label>
                    <!--单选题答案singleSelection-->
                    <div class="layui-input-block singleSelection">
                        <input type="radio" name="singleResult" class="singleResult" value="A" title="A">
                        <input type="radio" name="singleResult" class="singleResult" value="B" title="B">
                        <input type="radio" name="singleResult" class="singleResult" value="C" title="C">
                        <input type="radio" name="singleResult" class="singleResult" value="D" title="D">
                    </div>
                    <!--多选题答案multipleSelection-->
                    <div class="layui-input-block multipleSelection" hidden>
                        <input type="checkbox" name="multipleResult" class="multipleResult" value="A" title="A">
                        <input type="checkbox" name="multipleResult" class="multipleResult" value="B" title="B">
                        <input type="checkbox" name="multipleResult" class="multipleResult" value="C" title="C">
                        <input type="checkbox" name="multipleResult" class="multipleResult" value="D" title="D">
                    </div>
                </div>
            </div>

            <!--答案解析-->
            <div class="layui-form-item">
                <label class="layui-form-label">题目解析</label>
                <div class="layui-input-block">
                    <textarea name="qAnalyze" id="qAnalyze" placeholder="请输入解析" class="layui-textarea" style="resize: none"></textarea>
                </div>
            </div>

            <!--题目分值-->
            <div class="layui-form-item">
                <label class="layui-form-label">分值</label>
                <div class="layui-input-inline">
                    <input name="qScore" class="layui-input qScore" type="text" autocomplete="off" placeholder="请输入分值"  required lay-verify="required" >
                </div>
                <label class="layui-form-label exist_msg" ></label>
            </div>

            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-submit lay-filter="formDemo" id="butt">立即提交</button>
                    <button type="button" class="layui-btn layui-btn-danger" title="返回上一页" onclick="javascript:history.back(-1);">返回上一页</button>
                </div>
            </div>
        </form>
    </div>

    <script type="text/javascript" th:src="@{/static/js/jquery-3.2.1.min.js}"></script>
    <script type="text/javascript" th:src="@{/static/layui.js}"></script>
    <script type="text/javascript" th:src="@{/static/js/mouseClick.js}"></script>
    <script type="text/javascript" th:src="@{/static/js/validation.js}"></script>
    <script type="text/javascript" th:src="@{/static/js/admin/addQuestion.js}"></script>
</body>
</html>